﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DevMango_Core
{
    public partial class frmConnect : Form
    {
        public frmServerExplorer frmSE;
        public frmConnect()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int port = 27017;
            Connection con = new Connection();
            if (cmbPort.Text != "")
            {
                try
                {

                    port = int.Parse(cmbPort.Text);
                }
                catch
                {
                    MessageBox.Show("Enter Proper port value");
                }
            }
            con.connectServer(cmbServer.Text, port, cmdDB.Text, txtUser.Text, txtPassword.Text, frmSE, checkBox1.Checked);
        }
    }
}
